
package com.feib.soeasy.service.impl;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import com.feib.soeasy.dao.ColumnValidateErrorDao;
import com.feib.soeasy.model.ColumnValidateError;
import com.feib.soeasy.pagination.PaginatedList;
import com.feib.soeasy.service.ColumnValidateErrorService;


/**
 * @title (#)ColumnValidateErrorServiceImpl.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2010/12/14 create by Jimmy Liu<br>
 */
@Service("columnValidateErrorService")
public class ColumnValidateErrorServiceImpl extends BaseServiceImpl implements ColumnValidateErrorService {

    @Resource(name="columnValidateErrorDao")
    private ColumnValidateErrorDao columnValidateErrorDao;

    /**
     * 依據查詢物件查詢上傳轉入錯誤原因紀錄
     * @param columnValidateError 查
     * @param paginationConfig 換頁條件
     * @return 查詢結果物件
     */
    public PaginatedList<ColumnValidateError> queryByColumnValidateError( ColumnValidateError columnValidateError, PaginatedList<ColumnValidateError> paginationConfig) {

        // 設定 Default 排序  uploadDate desc
        if (StringUtils.isEmpty(paginationConfig.getSortCriterion()))
        {
            paginationConfig.setSortCriterion("lineNumber");
            paginationConfig.setSortDirection(PaginatedList.SORT_DIRECTION_ASC);
        }

        return columnValidateErrorDao.queryPaginationByColumnValidateError(columnValidateError, paginationConfig);
    }
}
